
package com.hlkj.pay.dto.ad.result;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import com.hlkj.framework.common.util.json.JsonUtils;
import lombok.Data;

/**
 * @author HlpayTeam
 * @date 2024/10/23 18:17
 */
@Data
public class HlRefundDataResultDto {

    /**
     * code : 1 msg : 请求成功 sign_type : RSA2 ins_id : M856437352 app_id :
     * APP_896564793562 data :
     * {"ins_id":"M856437352","app_id":"APP_896564793562","mch_order_no":"D20241023171359242849072","pay_order_id":"202410231714005658","mch_refund_no":"T20241023181556601422251","refund_amount":0.01,"refund_reason":"测试退款","refund_order_id":"202410231815587088","state":2}
     * sign :
     * McWTG6UDq80zDHjIFjB1eseYrDDOu1K8Hjqs/abv3gn9rhr5LxjWF+iMLmURZTyeFlwPvGYh9z51hgJlVI/En1KwLGKtX6zhGK53x9UlkW1D8AwbdolEKXtQdSoUer8r2ab8qU1for9POfPQ/TkxZfzoDGlqJ71sLoW4UG8avgJPtml2e6yxzplnTPsXTjfvLGLNKkqrZbCtO7rIE0L3oySHkcplzjS4VH9mS5eSwexv0aD/xpuT9tLlo0mts371KTt/S8jf7ysIYHjiPJTNqtKkNyVIcb6TbaG9AYqIfNxF4t9TEJ2j8KyC9RaH3UadfMLeDeD2EY1hCPSvrx+I8w==
     */

    private Integer code;

    private String msg;

    private String sign_type;

    private String ins_id;

    private String app_id;

    /**
     * ins_id : M856437352 app_id : APP_896564793562 mch_order_no :
     * D20241023171359242849072 pay_order_id : 202410231714005658 mch_refund_no :
     * T20241023181556601422251 refund_amount : 0.01 refund_reason : 测试退款
     * refund_order_id : 202410231815587088 state : 2
     */

    private Object data;

    private String sign;

    @Data
    public static class DataBean {

        private String ins_id;

        private String app_id;

        private String mch_order_no;

        private String pay_order_id;

        private String mch_refund_no;

        private Double refund_amount;

        private String refund_reason;

        private String refund_order_id;
        //0=退款失败，1=初始化，2=退款中，3=退款成功，
        private int state;
        private String err_msg;
        
    }
    public static void main(String[] args) {
        // String json="{\"code\":1,\"msg\":\"请求成功\",\"sign_type\":\"RSA2\",\"ins_id\":\"M856437352\",\"app_id\":\"APP_896564793562\",\"data\":{\"ins_id\":\"M856437352\",\"app_id\":\"APP_896564793562\",\"mch_order_no\":\"D20241101053958246926972\",\"pay_order_id\":\"202411011339580708\",\"mch_refund_no\":\"T20241101054948822509543\",\"refund_amount\":0.1,\"refund_reason\":\"一键退款\",\"refund_order_id\":\"202411011349485199\",\"state\":2},\"sign\":\"Ub2v61VpiJSm56E7TQnJ8EULH0oym7e8SHdDr9lmptMCw\\/rFe\\/i0VxmvrSoUh1NbMsgaRKZDy0bzUouJyZRToIemLqAkUsNs9CtOjWQjoJjM3AuR6A7HuiMe\\/KaXYJlJ1L8hFHbsZRkKPAfWIohovZyvty9nDsJS6064AsCEqhxkgNaH\\/Y0U9fLDyJ6vaD6cIC0nSSm8E3ZRXVurUX1ZpcO35w5kRtY4pN1GLNO5uYJ9hFgQwSBpsIrhto5EIPjrm6P9jSQCd0958Ujs5rMpjnHkAo35zSQ+oOeqXAYr\\/+L3bjjpTyyjDoqx8WtSvq85Ynfow++9HLm\\/R19c2YzqTQ==\"}";
        String json="{\"code\":1,\"msg\":\"请求成功\",\"sign_type\":\"RSA2\",\"ins_id\":\"M856437352\",\"app_id\":\"APP_896564793562\",\"data\":{\"ins_id\":\"M856437352\",\"app_id\":\"APP_896564793562\",\"mch_order_no\":\"D20241101053958246926972\",\"pay_order_id\":\"202411011339580708\",\"mch_refund_no\":\"T20241101055055080692208\",\"refund_amount\":0.1,\"refund_reason\":\"一键退款\",\"refund_order_id\":\"\",\"state\":0,\"err_msg\":\"退款失败：\\\"Business Failed交易已经关闭\\\"\"},\"sign\":\"Q5frWr9NdEDCuItYlJ7giJsXb7OhIFVN1evv65y79TnS1Xtj4EHTj3iNpiQuj50CuQDBrkpmc3i5ZNQBozGlL5vhZGBQx7rn5QDO1dwyR5QVb\\/aVE0xV1z\\/JEga0QxWN6zCmfPCKjQMa0jx7DEgWSGusTv+S4N626HU1OKrEmGU72LCigwEaKVr64UIlOeea5zTIUnFAZNUw2p\\/UGW2kvALKeOVh3HU64KKfTFxGOWxXRwHnktk2qNN6uG8yOpojh2tZlULn9PttuxthURVLReESoq1ljjXzBlK6uVfiv98\\/9tG6OOVmC2XSiT4pMbbttYQujt78ELgSIkNJ3C2Veg==\"}";
        HlRefundDataResultDto hlRefundDataResultDto = JsonUtils.parseObject(json, HlRefundDataResultDto.class);
        System.out.println();
        HlRefundDataResultDto.DataBean dataBean=JsonUtils.parseObject(JsonUtils.toJsonString(hlRefundDataResultDto.getData()),
                HlRefundDataResultDto.DataBean.class);
        
        System.out.println(dataBean);
    }
}
